<!DOCTYPE html>
<html ng-app="myApp">
<head>
    <meta charset="utf-8">
    <script type="text/javascript" src="../../../vendor/angular/angularjs.js"></script>
    <script type="text/javascript" src="index.js"></script>
    <style>
        .odd {
            background-color: blue;
        }
        .even {
            background-color: red;
        }
        input.ng-invalid {
            border: 1px solid red;
        }
        input.ng-valid {
            border: 1px solid green;
        }
    </style>
</head>
<body>
part1: ng-repeat
//javascript中的索引从0开始，所以我门用!$even,!$odd来将布尔值反转
<br/>
<ul ng-controller="PeopleController">
    <li ng-repeat="person in people" ng-class="{even: !$even, odd: !$odd}">
        {{person.name}} lives in {{person.city}}
    </li>
</ul>
part2: ng-form
<br/>
<form name="signup_form"
      ng-controller="FormController"
      ng-submit="submitForm()" novalidate>
    <div ng-repeat="field in fields"
         ng-form="signup_form_input">
        <input type="text"
               name="dynamic_input"
               ng-required="field.isRequired"
               ng-model="field.name"
               placeholder="{{field.placeholder}}" />
        <div
                ng-show="signup_form_input.dynamic_input.$dirty &&
 signup_form_input.dynamic_input.$invalid">
 <span class="error"
       ng-show="signup_form_input.dynamic_input.$error.required">
 The field is required.
 </span>
        </div>
    </div>
    <button type="submit"
            ng-disabled="signup_form.$invalid">
        Submit All
    </button>
</form>

<br/> part3: ng-select:<br/>
<div ng-controller="CityController">
    <select ng-model="city"
            ng-options="city.name for city in cities">
        <option value="">Choose City</option>
    </select>
    Best City: {{ city.name }}
</div>

</body>

</html>